# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Admin.Directory_v1.Model.ChromeOsDeviceCpuInfoLogicalCpus do
  @moduledoc """
  Status of a single logical CPU.

  ## Attributes

  *   `cStates` (*type:* `list(GoogleApi.Admin.Directory_v1.Model.ChromeOsDeviceCpuInfoLogicalCpusCStates.t)`, *default:* `nil`) - C-States indicate the power consumption state of the CPU. For more information look at documentation published by the CPU maker.
  *   `currentScalingFrequencyKhz` (*type:* `integer()`, *default:* `nil`) - Current frequency the CPU is running at.
  *   `idleDuration` (*type:* `String.t`, *default:* `nil`) - Idle time since last boot.
  *   `maxScalingFrequencyKhz` (*type:* `integer()`, *default:* `nil`) - Maximum frequency the CPU is allowed to run at, by policy.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cStates =>
            list(GoogleApi.Admin.Directory_v1.Model.ChromeOsDeviceCpuInfoLogicalCpusCStates.t())
            | nil,
          :currentScalingFrequencyKhz => integer() | nil,
          :idleDuration => String.t() | nil,
          :maxScalingFrequencyKhz => integer() | nil
        }

  field(:cStates,
    as: GoogleApi.Admin.Directory_v1.Model.ChromeOsDeviceCpuInfoLogicalCpusCStates,
    type: :list
  )

  field(:currentScalingFrequencyKhz)
  field(:idleDuration)
  field(:maxScalingFrequencyKhz)
end

defimpl Poison.Decoder, for: GoogleApi.Admin.Directory_v1.Model.ChromeOsDeviceCpuInfoLogicalCpus do
  def decode(value, options) do
    GoogleApi.Admin.Directory_v1.Model.ChromeOsDeviceCpuInfoLogicalCpus.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Admin.Directory_v1.Model.ChromeOsDeviceCpuInfoLogicalCpus do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
